package com.anxinr.controller;

import com.anxinr.pojo.dto.ShoppingDto;
import com.anxinr.pojo.entity.ShoppingInfo;
import com.anxinr.result.Result;
import com.anxinr.service.ShoppingInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : anxinr
 * @date : 2023/9/22 16:09
 */
@Slf4j
@RestController
@RequestMapping("/panicBuying")
public class PanicBuyingController {

    @Autowired
    private ShoppingInfoService infoService ;

    @PostMapping("/buy")
    private Result buy(ShoppingDto info){

        return Result.successBody(infoService.buying(info)) ;
    }
}
